﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My AI</title>
    <link rel="stylesheet" href="/static/plugins/bootstrap-5.3.0-dist/css/bootstrap.css">
    <link href="/static/css/font-awesome.min.css" rel="stylesheet">

    <link rel="stylesheet" href="/static/assets/css/jquery.mCustomScrollbar.min.css"/>
    <link rel="stylesheet" href="/static/assets/css/custom.css">
    <link rel="shortcut icon" href="/static/images/favicon.ico" />
</head>
<body>
<div class="page-wrapper toggled">{#去掉toggled则默认不显示菜单导航 #}
    <nav id="sidebar" class="sidebar-wrapper">
        <div class="sidebar-content">
            <a href="#" id="toggle-sidebar"><i class="fa fa-bars"></i></a>
            <span>
                <div style="width: 18%;display:inline-block"></div>
                <div style="width: 18%;display:inline-block">
                    <img class="img-responsive img-rounded" style="width: 100%;height: 100%;"
                         src="/static/assets/img/logo.png" alt="MAI">
                </div>
                <div id="LogoName" class="LogoName">My AI</div>
            </span>
            <div class="sidebar-header">
                {#                <div class="user-pic">#}
                {#                    <img class="img-responsive img-rounded" src="/static/assets/img/user.jpg" alt="">#}
                {#                </div>#}
                <span>
                    {% if request.session.is_login %}
{#                        <div style="width: 20%;display:inline-block;text-align: right">online:</div>#}
                        <div style="width: 45%;display:inline-block;text-align: center">
                            <strong>{{ request.session.user_name }}</strong>
                        </div>
                        <div style="width: 45%;display:inline-block;text-align: right">
                        <a href="/logout/">退出登录</a>
                    </div>
                    {% else %}
{#                        <div style="width: 20%;display:inline-block;text-align: right">未登录</div>#}
                        <div style="width: 45%;display:inline-block;text-align: center">
                            <strong><a href="/login/">登录</a></strong>
                        </div>
                        <div style="width: 45%;display:inline-block;text-align: right">
                            <a href="/signup/">注册</a>
                         </div>
                    {% endif %}
                </span>
            </div>
            <!-- sidebar-header  -->
            <div class="sidebar-search">
                <div>
                    <div class="input-group">
                        <input type="text" class="form-control search-menu" placeholder="搜索...">
                    </div>
                </div>
            </div>
            <!-- sidebar-search  -->
            <div class="sidebar-menu">
                <ul>
                    {% if firstmenu %}
                        {% for first in firstmenu %}
                            <!-- 绘制第一级菜单  -->
                            <li class="header-menu">
                                <i class="{{ first.iconclass }}"></i>
                                <span>
                                    {% if first.iframesrc %}
                                        <a href="{{ first.iframesrc }}" target="iframe">{{ first.firstmenu }}</a>
                                    {% else %}
                                        <a>{{ first.firstmenu }}</a>
                                    {% endif %}
                                </span>
                            </li>
                            <!-- 绘制第二级菜单  -->
                            {% for second in secondmenu %}
                                {% if second.firstmenu_id == first.id %}
                                    <li class="sidebar-dropdown">
                                        <a href="#"><i
                                                class="{{ second.iconclass }}"></i><span>{{ second.secondmenu }}</span><span
                                                class="label label-danger"></span></a>
                                        <div class="sidebar-submenu">
                                            <ul>
                                                <!-- 绘制第三级菜单  -->
                                                {% for third in thirdmenu %}
                                                    {% if third.secondmenu_id == second.id %}
                                                        <li>
                                                            <a href="{{ third.iframesrc|safe }}"
                                                               target="iframe">{{ third.thirdmenu }}<span
                                                                    class="label label-success"></span></a>
                                                        </li>
                                                    {% endif %}
                                                {% endfor %}
                                            </ul>
                                        </div>
                                    </li>
                                {% endif %}
                            {% endfor %}
                        {% endfor %}
                    {% endif %}
                </ul>
            </div><!-- sidebar-menu  -->
        </div><!-- sidebar-content  -->

        {#        <div class="sidebar-footer"> 底部菜单栏#}
        {#            <a href="#"><i class="fa fa-bell"></i><span class="label label-warning notification">3</span></a>#}
        {#            <a href="#"><i class="fa fa-envelope"></i><span class="label label-success notification">7</span></a>#}
        {#            <a href="#"><i class="fa fa-gear"></i></a>#}
        {#            <a href="#"><i class="fa fa-power-off"></i></a>#}
        {#        </div>#}
    </nav><!-- sidebar-wrapper  -->
    <main class="page-content">
        <div class="container-fluid">
            <iframe name="iframe" width="100%" height="100%" frameborder="0"
                    src="home.html"></iframe>
        </div>
    </main><!-- page-content" -->
</div><!-- page-wrapper -->


<script src="/static/plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="/static/plugins/bootstrap-5.3.0-dist/js/bootstrap.bundle.min.js"></script>
<script src="/static/assets/js//jquery.mCustomScrollbar.concat.min.js"></script>
<script src="/static/assets/js/custom.js"></script>
</body>
</html>